package testSudoku;

import static org.junit.Assert.assertEquals;

import java.util.Timer;

import org.junit.Test;

import sudoku.Manager;
import sudoku.Sudoku_main;
import sudoku.Validator;


public class testmain {

	// Test case 1: test function checkDifficulties() in class "main" when Difficulties is 2 
	@Test
	public void testcheckDifficulties1() 
	{
		boolean result;
		result = Sudoku_main.checkDifficulties(2,true);
		assertEquals(result,true);
	}
	
	// Test case 2: test function checkDifficulties() in class "main" when Difficulties is 5 
	@Test
	public void testcheckDifficulties2() 
	{
		boolean result;
		result = Sudoku_main.checkDifficulties(5,true);
		assertEquals(result,true);
	}
	
	// Test case 3: test function chooseQuestion() in class "main" when Question is 1 
	@Test
	public void testchooseQuestion1() 
	{
		boolean result;
		result = Sudoku_main.checkQuestion(1,false);
		assertEquals(result,true);
	}
	
	// Test case 4: test function chooseQuestion() in class "main" when Question is 4
	@Test
	public void testchooseQuestion2() 
	{
		boolean result;
		result = Sudoku_main.checkQuestion(4,false);
		assertEquals(result,false);
	}
	
	// Test case 5: test function invalidLength_Range() in class "main" when the length of input is invalid
	@Test
	public void testinvalidLength_Range1() 
	{
		boolean result;
		Manager m = new Manager();
		
		result = Sudoku_main.invalidLength_Range(m,"a");
		assertEquals(result,true);
	}
	
	// Test case 6: test function invalidLength_Range() in class "main" when the length of input is valid
	@Test
	public void testinvalidLength_Range2() 
	{
		boolean result;
		Manager m = new Manager();
		result = Sudoku_main.invalidLength_Range(m,"1");
		assertEquals(result,false);
	}
	
	// Test case 7: test function invalidLength_Range_Position() in class "main" when the length of input is invalid
	@Test
	public void testinvalidLength_Range_Position1() 
	{
		boolean result;
		Manager m = new Manager();
		result = Sudoku_main.invalidLength_Range_Position(m,"a",2,2);
		assertEquals(result,true);
	}
	
	// Test case 8: test function invalidLength_Range_Position() in class "main" when the length of input is valid
	@Test
	public void testinvalidLength_Range_Position2() 
	{
		boolean result;
		Manager m = new Manager();
		result = Sudoku_main.invalidLength_Range_Position(m,"1",2,2);
		assertEquals(result,false);
	}
	
	
}
